﻿using System.Configuration;
using System.Text;
using Wei8808Cms.BLL;
using Wei8808Cms.Model;
using Wei8808Cms.Utility;

namespace Wei8808Cms.WebSite.UI
{
    public class WebSiteBaseicPage : System.Web.UI.Page
    {
        protected internal WebSet webset;

        public WebSiteBaseicPage()
        {
            webset = new WebSetBLL().LoadConfig(Server.MapPath(ConfigurationManager.AppSettings["Configpath"]));
        }

        /// <summary>
        /// 添加页面Meta信息
        /// </summary>
        /// <param name="seokeywords">关键词</param>
        /// <param name="seodescription">说明</param>
        /// <param name="seohead">其它增加项</param>
        public string AddMetaInfo(string seokeywords, string seodescription, string seohead)
        {
            var strTxt = new StringBuilder();
            if (seokeywords != "")
            {
                strTxt.Append("<meta name=\"keywords\" content=\"" + StringPlus.DropHTML(seokeywords, 250).Replace("\"", " ") + "\" />\r\n");
            }
            if (seodescription != "")
            {
                strTxt.Append("<meta name=\"description\" content=\"" + StringPlus.DropHTML(seodescription, 250).Replace("\"", " ") + "\" />\r\n");
            }
            strTxt.Append("<link rel=\"icon\" href=\"favicon.ico\" mce_href=\"favicon.ico\" type=\"image/x-icon\"> \r\n");
            strTxt.Append("<link rel=\"shortcut icon\" href=\"favicon.ico\" mce_href=\"favicon.ico\" type=\"image/x-icon\"> \r\n");
            strTxt.Append(seohead);
            return strTxt.ToString();
        }

        
    }
}